package com.cpos.cposcommon.thread;

import lombok.extern.slf4j.Slf4j;

/*
 *  @创建人  Leiwenlong
 *  @创建时间 2020/11/29
 *  @描述   线程
 */
@Slf4j
public class ThreadController {

    public void thread() {
        Thread thread = new Thread(){
            @Override
            public void run() {
                super.run();
                log.debug("starting....");
            }
        };
        thread.setName("t1");
        thread.start();
        log.debug("starting....");
    }

    public void runnable(){
        Runnable runnable = () ->   log.debug("runnable...");

        Thread t2 = new Thread(runnable);
        log.debug("runnable...");
        t2.start();
    }



}
